﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="holiday.aspx.cs" Inherits="AnyOffice.general.system.attend.holiday" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>考勤节假日设置</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<link rel="stylesheet" type="text/css" href="/module/date_selector/popcalendar.css">
			<script src="/module/date_selector/popcalendar.js"></script>
			<script src="/aspnet_client/core/function.js"></script>
			<script Language="JavaScript">

function CheckForm()
{
	if(document.Form1.txtBeginDate.value == "")
   {
	 alert("起始日期不能为空！");
	 document.Form1.txtBeginDate.focus();
	 return (false);
   }
   
   if(!checkIsDate(document.Form1.txtBeginDate.value))
   {
	 alert("起始日期不正确！");
	 document.Form1.txtBeginDate.focus();
	 return (false);
   }
   
   if(document.Form1.txtEndDate.value == "")
   {
	 alert("截止日期不能为空！");
	 document.Form1.txtEndDate.focus();
	 return (false);
   }
   
   if(!checkIsDate(document.Form1.txtEndDate.value))
   {
	 alert("截止日期不正确！");
	 document.Form1.txtEndDate.focus();
	 return (false);
   }
   
   if(!checkDateEarlier(document.Form1.txtBeginDate.value, document.Form1.txtEndDate.value))
   {
     alert("开始日期不能晚于结束日期！");
	 return (false);   
   }
   
   return true;
}

function delete_holiday(HOLIDAY_ID)
{
 msg='确认要删除该项日期么？';
 if(window.confirm(msg))
 {
  HOLIDAY="holiday_del.aspx?holiday_id=" + HOLIDAY_ID;
  window.location=HOLIDAY;
 }
}


function delete_all()
{
 msg='确认要删除所有日期么？';
 if(window.confirm(msg))
 {
  URL="holiday_delall.aspx";
  window.location=URL;
 }
}
</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/notify_new.gif" align="absMiddle"><span class="big3"> 添加考勤节假日</span>
					</td>
				</tr>
			</table>
			<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3"
				align="center">				
					<TBODY>
						<tr>
							<td nowrap class="TableData">起始日期：</td>
							<td nowrap class="TableData"><INPUT class="BigInput" id="txtBeginDate" type="text" maxLength="10" size="10" name="txtBeginDate"
									runat="server"><IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtBeginDate,'yyyy-mm-dd','');"
									src="/module/date_selector/calendar.gif" align="absMiddle" border="0">
							</td>
						<tr>
							<td nowrap class="TableData">结束日期：</td>
							<td nowrap class="TableData"><INPUT class="BigInput" id="txtEndDate" type="text" maxLength="10" size="10" name="txtEndDate"
									runat="server"><IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtEndDate,'yyyy-mm-dd','');" src="/module/date_selector/calendar.gif"
									align="absMiddle" border="0">
							</td>
						</tr>
						<tr>
							<td nowrap class="TableControl" colspan="2" align="center">
								<input type="submit" value="添加" onclick="return CheckForm();" class="BigButton" title="添加日期"
									name="button">
							</td>
				
				</TR>
				</TBODY>
			</table>
			<br>
			<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
				<tr>
					<td background="/images/dian1.gif" width="100%"></td>
				</tr>
			</table>
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/notify_open.gif" align="absMiddle"><span class="big3"> 管理考勤节假日</span>
					</td>
				</tr>
			</table>
			<div align="center">
				<asp:Repeater id="rptHoliday" runat="server">
				<HeaderTemplate>
				<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3">
				 <tr class="TableHeader">
      <td nowrap align="center">序号</td>
      <td nowrap align="center">起始日期</td>
      <td nowrap align="center">结束日期</td>
      <td nowrap align="center">操作</td>
    </tr>
				</HeaderTemplate>
				<ItemTemplate>
				<tr class="TableData">
      <td nowrap align="center"><%#Eval("HolidayId")%></td>
      <td nowrap align="center"><%#Convert.ToDateTime(Eval("BeginDate")).ToString("d")%></td>
      <td nowrap align="center"><%#Convert.ToDateTime(Eval("EndDate")).ToString("d")%></td>
      <td nowrap align="center" width="80">
      <a href="holiday_edit.aspx?holiday_id=<%#Eval("HolidayId")%>"> 编辑</a>
      <a href="javascript:delete_holiday('<%#Eval("HolidayId")%>');"> 删除</a>
      </td>
    </tr>
				</ItemTemplate>
				<FooterTemplate>
				<tr class="TableControl">
      <td nowrap align="center" colspan="5">
      <input type="button" class="BigButton" OnClick="javascript:delete_all();" value="全部删除">
      </td>
    </tr>
				</table>
				<br>
				</FooterTemplate>
				</asp:Repeater>
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<input type="button" value="返回" class="BigButton" onClick="location='index.aspx';">
			</div>
		</form>
	</body>
</HTML>
